<ui:composition xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://xmlns.jcp.org/jsf/html"
      xmlns:f="http://xmlns.jcp.org/jsf/core"
      xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
      xmlns:p="http://primefaces.org/ui"
      xmlns:pe="http://primefaces.org/ui/extensions"      
      xmlns:b="http://xmlns.jcp.org/jsf/composite/bunsysComponents"
      template="/WEB-INF/templates/template.xhtml">
      <ui:param name="idForm" value="frmCobros" />
      <ui:param name="controller" value="#{cobrosController}" />
      <ui:define name="contentBody">
      	<p:panel header="Cobros">
      		<p:fieldset legend="#{msg['lbl_busqueda']}">
      			<h:panelGroup layout="block">
	      			<h:panelGrid columns="3">
	      				<p:outputLabel value="#{msg['lbl_num_fac']}:" for="txtNumFac" style="display: block; width:150px;"/>
		      			<p:inputText id="txtNumFac" value="#{cobrosDatamanager.cxcSearch.numerofactura}">
		      				<pe:keyFilter for="txtNumFac"/>
		      			</p:inputText>
		      			<p:message for="txtNumFac"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_identificacion']}:" for="txtId" style="display: block; width:150px;"/>
		      			<p:inputText id="txtId" value="#{cobrosDatamanager.cxcSearch.tfaccliente.tsyspersona.identificacion}"/>
		      			<p:message for="txtId"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_nombre']}:" for="txtNombre" style="display: block; width:150px;"/>
		      			<p:inputText id="txtNombre" value="#{cobrosDatamanager.cxcSearch.tfaccliente.tsyspersona.nombres}"/>
		      			<p:message for="txtNombre"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_apellidos']}:" for="txtIApellido" style="display: block; width:150px;"/>
		      			<p:inputText id="txtIApellido" value="#{cobrosDatamanager.cxcSearch.tfaccliente.tsyspersona.apellidos}"/>
		      			<p:message for="txtIApellido"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_fec_emi_cob']}:" for="txtEmision" style="display: block; width:150px;"/>
		      			<p:calendar id="txtEmision" pattern="#{msg['pattern_date']}" mask="true" value="#{cobrosDatamanager.cxcSearch.fechaemision}"/>
		      			<p:message for="txtEmision"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_fec_ven']}:" for="txtFecVen" style="display: block; width:150px;"/>
		      			<p:calendar id="txtFecVen" pattern="#{msg['pattern_date']}" mask="true" value="#{cobrosDatamanager.cxcSearch.fechavence}"/>
		      			<p:message for="txtFecVen"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_fec_cob']}:" for="txtFecCobro" style="display: block; width:150px;"/>
		      			<p:calendar id="txtFecCobro" pattern="#{msg['pattern_date']}" mask="true" value="#{cobrosDatamanager.cxcSearch.fechapago}"/>
		      			<p:message for="txtFecCobro"/>
		      			
		      			<p:outputLabel value="#{msg['lbl_num_doc']}:" for="txtNumDoc" style="display: block; width:150px;"/>
		      			<p:inputText id="txtNumDoc" value="#{cobrosDatamanager.cxcSearch.numdoc}">
		      				<pe:keyFilter for="txtNumDoc"/>
		      			</p:inputText>
		      			<p:message for="txtNumDoc"/>
		      		</h:panelGrid>
		      	</h:panelGroup>
		      	<h:panelGroup layout="block" style="float:left">
		  			<p:commandButton icon="ui-icon-search" value="#{msg['btn_buscar']}" action="#{cobrosController.buscar()}" update="pnlDataCxc"/>
		  			<p:commandButton icon="ui-icon-plusthick" 
		  				value="#{msg['btn_crear']}">
		  				<f:setPropertyActionListener target="#{proveedorDatamanager.proveedorComponente.edition}" value="false"/>
		  			</p:commandButton>
		  		</h:panelGroup>
      		</p:fieldset>
      		<p:fieldset legend="#{msg['lbl_cobros']}">
      			<h:panelGroup layout="block" id="pnlDataCxc">
      				<p:dataTable value="#{cobrosDatamanager.cxcColl}" var="cobros">
      					<p:column headerText="#{msg['lbl_num_doc']}">
      						<h:outputText value="#{cobros.numdoc}" />
      					</p:column>
      					<p:column headerText="#{msg['lbl_codigo_cliente']}">
      						<h:outputText value="#{cobros.tfaccliente.pk.codigocliente}" />
      					</p:column>
      					<p:column headerText="#{msg['lbl_nombres_apellidos']}">
      						<h:outputText value="#{cobros.tfaccliente.tsyspersona.apellidos} #{cobros.tfaccliente.tsyspersona.nombres}" />
      					</p:column>
      					<p:column headerText="#{msg['lbl_fec_cob']}">
      						<h:outputText value="#{cobros.fechapago}">
      							<f:convertDateTime pattern="#{msg['pattern_date']}"/>
      						</h:outputText>
      					</p:column>
      					<p:column headerText="#{msg['lbl_num_fac']}">
      						<h:outputText value="#{cobros.numerofactura}" />
      					</p:column>
      				</p:dataTable>
      			</h:panelGroup>
      		</p:fieldset>
      	</p:panel>
      </ui:define>
</ui:composition>